﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Happy.Primitive;

namespace Happy.Domain
{
    /// <summary>
    /// 领域服务基类。
    /// </summary>
    public abstract class DomainService : ServiceBase
    {
    }

    /// <summary>
    /// 领域服务基类。
    /// </summary>
    public abstract class DomainService<TAggregate, TId, TRepository> : ServiceBase
        where TAggregate : IAggregateRoot<TId>
        where TRepository : IRepository<TAggregate, TId>
    {
        /// <summary>
        /// 仓储。
        /// </summary>
        protected TRepository Repository
        {
            get
            {
                return this.Service<TRepository>();
            }
        }
    }

    /// <summary>
    /// 领域服务基类。
    /// </summary>
    public abstract class DomainService<TAggregate, TId> : DomainService<TAggregate, TId, IRepository<TAggregate, TId>>
        where TAggregate : IAggregateRoot<TId>
    {
    }
}
